package org.mm.xml.entities;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlType;


/**
 * TherapyXML
 *
 * @author Marco Traversari
 * @version $Revision: $ $Date: $ $Author: $
 */
@XmlType (propOrder = {"name", "description", "therapyType", "therapyTasks"})
public class TherapyXML extends EntityXML {

	protected TherapyTypeXML therapyType = null;

	protected List<TherapyTaskXML> therapyTasks = null;

	/**
	 * getTherapyType
	 * @return therapyType
	 */
	public TherapyTypeXML getTherapyType() {
		return therapyType;
	}

	/**
	 * setTherapyType
	 * @param therapyType
	 */
	public void setTherapyType(TherapyTypeXML therapyType) {
		this.therapyType = therapyType;
	}

	/**
	 * getTherapyTasks
	 * @return therapyTasks
	 */
	@XmlElementWrapper(name = "therapyTasks")
	@XmlElement(name = "therapyTask")
	public List<TherapyTaskXML> getTherapyTasks() {
		return therapyTasks;
	}

	/**
	 * setTherapyTasks
	 * @param therapyTasks
	 */
	public void setTherapyTasks(List<TherapyTaskXML> therapyTasks) {
		this.therapyTasks = therapyTasks;
	}

	public void addTherapyTask(TherapyTaskXML therapyTask) {
		if (therapyTasks == null) {
			therapyTasks = new ArrayList<TherapyTaskXML>();
		}
		therapyTasks.add(therapyTask);
	}


}
